package com.huarui.part.dao.impl;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;

import com.huarui.part.dao.IPartCategoryDao;
import com.huarui.part.model.PartCategory;

public class PartCagtegoryDao extends BaseDaoImpl implements IPartCategoryDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<PartCategory> getFirstLevel() {
		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getFirstLevel");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PartCategory> getSubLevel(Integer level1Id) {
		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getSubLevel", level1Id);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PartCategory> getSubLevelById(Integer id) {
		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getSubLevelById", id);
	}

	@Override
	@SuppressWarnings("unchecked")
	public List<Map<String, Object>> getPartCategoryListByComplex(
			Map<String, Object> paramsMap) {
		return this.getSqlMapClientTemplate().queryForList(
				super.namespace + ".getPartCategoryListByComplex", paramsMap);
	}

	@Override
	public Integer getPartCategoryListCountByComplex(
			Map<String, Object> paramsMap) {
		return (Integer) this.getSqlMapClientTemplate().queryForObject(
				super.namespace + ".getPartCategoryListCountByComplex",
				paramsMap);
	}

}
